package com.parkreport.login.service;

import java.util.Hashtable;
import java.util.Vector;

import com.common.base.BaseService;
import com.common.jdbc.DB4MapUtil;
import com.parkreport.vo.UsersVO;

public class LoginService extends BaseService {

	
	public boolean login(UsersVO vo){
		boolean isLogin = false;
		String sql = "select * from users where 1=1 and username=? and password=?";
		Vector<Hashtable> v = DB4MapUtil.execute4Map(sql, vo.getUsername(),vo.getPassword());
		if(v.size()>0){
			isLogin=true;
			vo.setUserFullname((String) v.get(0).get("USER_FULLNAME"));
			vo.setRoleId((String) v.get(0).get("ROLE_ID"));
			vo.setId((String) v.get(0).get("ID"));
		}
		
		return isLogin;
	}
}
